home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XA_6S.ZIP / SOURCE / RESZWIDG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-12  |  1.6 KB  |  61 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include <OSBIND.H>
  9. #include <VDI.H>
  10. #include <string.h>
  11. #include "XA_TYPES.H"
  12. #include "XA_DEFS.H"
  13. #include "XA_GLOBL.H"
  14. #include "KERNAL.H"
  15. #include "K_DEFS.H"
  16. #include "GRAF_MOU.H"
  17. #include "MESSAGES.H"
  18. #include "C_WINDOW.H"
  19. #include "RECTLIST.H"
  20. #include "ALL_WIDG.H"
  21. #include "STD_WIDG.H"
  22. #include "drag_box.h"
  23. #include "OBJECTS.H"
  24. #include "SYSTEM.H"
  25.  
  26. /*======================================================
  27.     RESIZE WIDGET BEHAVIOUR
  28. ========================================================*/
  29. short drag_resize(XA_WINDOW *wind, XA_WIDGET *widg)
  30. {
  31.     short w,h;
  32.     
  33.     clear_clip();
  34.  
  35.     graf_mouse(XACRS_RESIZER, NULL);        /* Always have a nice consistent SIZER when resizing a window */
  36.     rubber_box(wind->x, wind->y, WIDGET_SIZE+20, WIDGET_SIZE+20, &w, &h);
  37.     graf_mouse(clients[window_list->owner].client_mouse, clients[window_list->owner].client_mouse_form);    /* Restore the mouse now we've done the drag */
  38.  
  39. /* Send a message to the client to say that the AES would like the window re-sizing */
  40.     if ((w!=wind->w)||(h!=wind->h))
  41.         send_app_message(wind->owner, WM_SIZED, 0, wind->handle, wind->x, wind->y, w, h);
  42.  
  43.     return TRUE;
  44. }
  45.  
  46. short display_resize(XA_WINDOW *wind, XA_WIDGET *widg)
  47. {
  48.     short x,y;
  49.  
  50.     rp_2_ap(wind, widg, &x, &y);    /* Convert relative coords and window location to absolute screen location */
  51.  
  52.     if (widg->stat==XAW_PLAIN)
  53.         def_widgets[WIDG_SIZE].ob_state&=~SELECTED;
  54.     else
  55.         def_widgets[WIDG_SIZE].ob_state|=SELECTED;
  56.     
  57.     display_object(def_widgets,WIDG_SIZE,x,y);
  58.  
  59.     return TRUE;
  60. }
  61.